repo: Fix temporary directory allocation
authorAlexander Larsson <alexl@redhat.com>
Fri, 22 Apr 2016 07:29:59 +0000 (09:29 +0200)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Fri, 22 Apr 2016 08:46:53 +0000 (08:46 +0000)
We looked for and locked old temporary directories so we can
reuse them if not in use. However, once we found one that
we can reuse we didn't stop iterating, and eventually we
reached the end. This means we can lock multiple dirs.

Closes: #273
Approved by: giuseppe

src/libostree/ostree-repo.c

index 875c94808e3864916383361af9ebdebf9d0b415d..35bc3a5d5a20826c8831c0ae09c82813cfbd8494 100644 (file)
@@ -5012,7 +5012,7 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
   if (!glnx_dirfd_iterator_init_at (tmpdir_dfd, ".", FALSE, &dfd_iter, error))
     return FALSE;
 
-  while (TRUE)
+  while (tmpdir_name == NULL)
     {
       gs_dirfd_iterator_cleanup GSDirFdIterator child_dfd_iter = { 0, };
       struct dirent *dent;